package extend;

public class Cat extends Animal {
    int love;
    public void printInfo(){
        System.out.println("名字是" + name + "年龄是" + age + "颜色是" + color + "爱吃什么" + love);
    }
    public static void main(String[] args) {
        Cat cat = new Cat();
        cat.name = "花花";
        cat.age = 2;
        cat.color = "白色";
        cat.love = 100;
        cat.printInfo();
    }
}

class Animal {
    String name;
    int age;
    String color;

    public void printInfo() {
        System.out.println("名字是" + name + "年龄是" + age + "颜色是" + color);
    }
}